home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / samples / AUX-support / man / linkman < prev    next >
Encoding:
Text File  |  1992-09-07  |  572 b   |  30 lines

  1. #!/bin/sh
  2. # @(#) linkman 1.1 - link to existing man page
  3. #
  4. # Bob Denny - Mon Sep 16 17:02:40 1991
  5. #
  6. # If orig and link end in ".z", but orig is there without ".z"
  7. # (pack not needed), will link new without the ".z". Needed for
  8. # A/UX pre-formatted man page system.
  9. #
  10. # BUGS: Should support symbolic links
  11.  
  12. src=$1
  13. srcnoz=`echo $1 | sed 's/\(.*\)\.z$/\1/`
  14. dest=$2
  15. destnoz=`echo $2 | sed 's/\(.*\)\.z$/\1/`
  16.  
  17. rm -f $dest $destnoz
  18.  
  19. if [ -f $src ] ; then
  20.     ln $src $dest
  21. elif [ -f $srcnoz ] ; then
  22.     ln $srcnoz $destnoz
  23. else
  24.     echo "$0: source $1 nonexistent."
  25.     exit 1
  26. fi
  27. exit 0
  28.  
  29.  
  30.